import { Controller, Post, Body } from '@nestjs/common';
import { CodeSendDTO } from './third.dto'
import { ThirdService } from './third.service'
import * as db from '../../entity'

@Controller('third')
export class ThirdController {
    constructor(private readonly thirdService: ThirdService) { }

    @Post('user.code.send')
    userCodeSend(@Body() mobileInfo: CodeSendDTO) {
        return this.thirdService.sendCode(mobileInfo, db.SmsCodeTypeEnum.USER);
    }

    @Post('crediter.code.send')
    crediterCodeSend(@Body() mobileInfo: CodeSendDTO) {
        return this.thirdService.sendCode(mobileInfo, db.SmsCodeTypeEnum.CREDITER);
    }
}